# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
# stolen from Archlinux

pkgname=re2c
pkgver=1.3
pkgrel=1
arch=('i686' 'x86_64')
depends=(gcc-libs)
pkgdesc='A tool for generating C-based recognizers from regular expressions'
url='https://re2c.org/'
license=('public domain')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/skvadrik/re2c/archive/${pkgver}.tar.gz)
sha256sums=('81d63a1b10af4b4cc676afaa0367caf12c23ad8750c10da149d5ac3cf5229023')

prepare() {
  cd ${pkgname}-${pkgver}
  autoreconf -fiv
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make tests
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
